<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>12.23</title>
</head>
<body>
    <script>
        function Point(x,y){
  this.x=x;
  this.y=y;
  this.moveTo=function(x,y){
  this.x=x;
  this.y=y;
  console.log(this.x+","+this.y); 
  //1,1
  //10,10
  }
}
var p1=new Point(0,0);
var p2={x:0,y:0};
p1.moveTo(1,1);
p1.moveTo.apply(p2,[10,10]);
var array = ['a', 'b'];
var elements = [0, 1, 2];
array.push.apply(array, elements);
console.info(array); // ["a", "b", 0, 1, 2] //apply  把后面的数组追加到前一个数组中
       </script>
</body>
</html>